/**
 * Copyright 2025 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

:host {
    display: inline-flex;
}

:host([quiet]) {
    min-width: 0;
}

:host > sp-menu {
    display: none;
}

::slotted([slot="icon"]) {
    flex-shrink: 0;
}

.icon {
    /**
     * Because .icon is acting as default content for its slot, the `::slotted([slot="icon"])` styles do not apply.
     * In the future it may be necessary to add a default content selector to the style processing code.
     */
    flex-shrink: 0;
}

#popover {
    max-width: none;
}

:host([dir="ltr"]) ::slotted([slot="icon"]),
:host([dir="ltr"]) .icon {
    /* [dir=ltr] .spectrum-ActionButton .spectrum-Icon */
    margin-left: calc(-1 * (var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted)));
}

:host([dir="rtl"]) ::slotted([slot="icon"]),
:host([dir="rtl"]) .icon {
    /* [dir=rtl] .spectrum-ActionButton .spectrum-Icon */
    margin-right: calc(-1 * (var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted)));
}

:host([dir]) slot[icon-only]::slotted([slot="icon"]),
:host([dir]) slot[icon-only] .icon {
    margin-inline: calc((var(--custom-actionbutton-edge-to-text, var(--spectrum-actionbutton-edge-to-text)) - var(--custom-actionbutton-edge-to-visual-only, var(--spectrum-actionbutton-edge-to-visual-only))) * -1); /* .spectrum-ActionButton-hold+.spectrum-ActionButton-icon,
   * .spectrum-ActionButton-icon:only-child */
}

sp-overlay:not(:defined) {
    display: none;
}
